/*
 * @Description: 学生管理系统类
 * @Author: rendc
 * @Date: 2023-11-24 19:22:48
 * @LastEditors: rendc
 * @LastEditTime: 2023-11-24 19:55:19
 */
import java.util.Scanner;
public class StudentManagement{
  // 存放学生对象的数组
  private Student[] students;
  // 实际学生的个数
  private int counter;
  // 键盘录入对象
  public Scanner in;
  // 构造器
  public StudentManagement(){
    // 默认学生数组容量为100
    students = new Student[100];
    // 初始化键盘输入对象
    in = new Scanner(System.in);
  }
  public StudentManagement(int size){
    // 默认学生数组容量为100
    students = new Student[size];
    // 初始化键盘输入对象
    in = new Scanner(System.in);
  }
  // 输出提示
  public void prompt(){
    System.out.println("********************");
    System.out.println("*Student Management*");
    System.out.println("********************");
    System.out.println("*1)Add");
    System.out.println("*2)Del");
    System.out.println("*3)Upd");
    System.out.println("*4)Sel");
    System.out.println("*0)Quit");
    System.out.println("********************");
    System.out.print("Please choose your operate:");
  }
  // 新增学生信息
  public void addStudent(){
    String name;
    String gender;
    int age;
    Student student;
    // 获取用户输入
    System.out.print("Please input name:");
    name = in.next();
    System.out.print("Please input gender:");
    gender = in.next();
    System.out.print("Please input age:");
    age = in.nextInt();
    student = new Student(name,age,gender);
    students[counter] = student;
    counter++;
    System.out.println("Add student successfully");
  }
}
